import java.util.Scanner;

/**
 * @author 1x
 * @Description
 * @date 2019/11/6
 */
public class Demo6 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入会员卡");
        int num = input.nextInt();
        if (num < 9999 && num > 1000) {
            String s = String.valueOf(num);
            System.out.println("会员卡是：" + s);
            int a = num % 10;
            int b = num / 10 % 10;
            int c = num / 100 % 10;
            int d = num / 1000;
            int Num = a + b + c + d;
            System.out.print("千位数：" + d);
            System.out.print("\t百位数：" + c);
            System.out.print("\t十位数：" + b);
            System.out.println("\t个位数：" + a);
            System.out.println("求和:" + Num);
            if (Num>=20){
                System.out.println("恭喜会员卡"+s+"的卡主中奖了，奖品是MP3");
          }else {
              System.out.println("谢谢参与活动");
            }
        }else{
            System.out.println("会员卡错误，请重新输入");
        }
    }
}